package gui.tabs;

import java.awt.Color;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.border.Border;
import javax.swing.border.EtchedBorder;
import javax.swing.border.TitledBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

public class LogTab extends JPanel implements ChangeListener {

	private static JTextArea logArea;
	
	protected Color backColour;
	protected Color listColour;
	
	public LogTab()
	{
		setBackground(backColour);
		
		Border raisedetched = BorderFactory.createEtchedBorder(EtchedBorder.RAISED);
		
		Border titled = BorderFactory.createTitledBorder(raisedetched,
				"Log Tab",TitledBorder.CENTER,TitledBorder.TOP);
		
		setLayout(new GridLayout(1,5));
		setBackground(backColour);
		backColour = new Color(193,255,193);
		listColour = new Color(224,238,238);
		
		logArea = new JTextArea();
		//logArea.setBackground(listColour);
		logArea.setLineWrap(true);
		logArea.setEditable(false);
		
		JScrollPane scrollPane = new JScrollPane(logArea);
		
		scrollPane.setBorder(titled);
		
		add(scrollPane);
	}
	
	public static void logInput(String s)
	{
		logArea.insert( " " + s + "\n\n", 0);
	}
	

	@Override
	public void stateChanged(ChangeEvent e) {
		// TODO Auto-generated method stub
		
	}

}
